package com.example.mountainwalker.service.impl;

import com.example.mountainwalker.entity.GroupTourFavoriteInfo;
import com.example.mountainwalker.mapper.GroupTourFavoriteMapper;
import com.example.mountainwalker.service.GroupTourFavoriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GroupTourFavoriteServiceImpl implements GroupTourFavoriteService {
    @Autowired
    private GroupTourFavoriteMapper groupTourFavoriteMapper;

    @Override
    public List<GroupTourFavoriteInfo> getGroupTourFavorite() {
        List<GroupTourFavoriteInfo> groupTourFavoriteList = groupTourFavoriteMapper.getGroupTourFavorite();
        return groupTourFavoriteList;
    }

    @Override
    public GroupTourFavoriteInfo getGroupTourFavoriteById(Integer id) {
        GroupTourFavoriteInfo groupTourFavorite = groupTourFavoriteMapper.getGroupTourFavoriteById(id);
        return groupTourFavorite;
    }

    @Override
    public int deleteGroupTourFavoriteById(Integer id) {
        int result = groupTourFavoriteMapper.deleteGroupTourFavoriteById(id);
        return result;
    }
    @Override
    public int addGroupTourFavorite(GroupTourFavoriteInfo groupTourFavoriteInfo) {
        return groupTourFavoriteMapper.addGroupTourFavorite(groupTourFavoriteInfo);
    }

    @Override
    public int updateGroupTourFavorite(GroupTourFavoriteInfo groupTourFavoriteInfo) {
        return groupTourFavoriteMapper.updateGroupTourFavorite(groupTourFavoriteInfo);
    }
}
